<?xml version="1.0" encoding="UTF-8" ?>
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
	<ui:param name="bean" value="#{bean}" />
	<ui:param name="autoUpdate" value="#{autoUpdate}" />
	<ui:param name="permissaoIncluir" value="#{permissaoIncluir}" />
	<ui:param name="permissaoAlterar" value="#{permissaoAlterar}" />
	<ui:param name="permissaoExcluir" value="#{permissaoExcluir}" />
	<ui:param name="showNovo" value="#{showNovo}" />
	<ui:param name="showEdit" value="#{showEdit}" />
	<ui:param name="showRemove" value="#{showRemove}" />
	<ui:param name="editHeader" value="#{editHeader}" />

	<div class="table-responsive">
		<p:dataTable id="datatable#{bean.name}" var="item"
			value="#{bean.dataModel}" tableStyleClass="table no-border hover"
			rowStyleClass="no-border-y" paginator="true" rows="10"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
			rowsPerPageTemplate="5,10,15"
			emptyMessage="#{messageResources['MSG013']}">

			<ui:insert name="contentGridListagem" />

			<p:column headerText="Ação" style="width:15%;"
				styleClass="text-center no-border text-center">
				<h:outputText />

				<p:commandLink id="cmdLinkAlterar" styleClass="label label-default"
					oncomplete="funcMask()" onclick="dlg.show()"
					update="datatable#{bean.name}">
					<i class="fa fa-pencil"></i>
				</p:commandLink>


				<p:commandLink onclick="return confirm('#{messages['MSG002']}')" id="cmdLinkExcluir" styleClass="label label-danger" 
					action="#{bean.remove(item.id)}">
					<f:param name="id" value="#{item.id}" />
					<i class="fa fa-times"/>
				</p:commandLink>
			</p:column>
		</p:dataTable>
	</div>
</ui:composition>